package com.example.wastewater.controller;

import com.example.wastewater.common.convention.result.Result;
import com.example.wastewater.common.convention.result.Results;
import com.example.wastewater.service.IEmailService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *  邮箱管理控制层
 */
@RestController
@RequiredArgsConstructor
public class EmailController {

    private final IEmailService emailService;
    @GetMapping("/api/waste-water/admin/v1/send-email")
    public Result<Void> sendEmail(@RequestParam String to, @RequestParam String title, @RequestParam String text) {
        emailService.sendEmail(to, title, text);
        return Results.success();
    }
}
